package usc.cs.survey;

import java.util.Calendar;
import java.util.TimeZone;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;

public class Survey extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);  
   
        System.out.println("Test Show");
        Date_to_MilliSeconds(9,5,2012,1,28);
    	
    	
        
    }
    
    public void ScheduleOnClick(View ScheduleView)
    {

    	NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    	Notification notification = new Notification(R.drawable.ic_launcher, "Breaking News", System.currentTimeMillis());
    	notification.number+=5;
    	PendingIntent contentIntent = PendingIntent.getActivity(this, 0, getIntent(), 0);
    	notification.setLatestEventInfo(this, "See this", "Hope so", contentIntent);
    	notificationManager.notify(R.drawable.ic_launcher, notification);

    	
    	
    }
    
    public void StartOnClick(View StartDoingSurveyView)
    {
    	Intent myIntent = new Intent(StartDoingSurveyView.getContext(), Screen2.class);
        startActivityForResult(myIntent, 0);
    }
    
    public long Date_to_MilliSeconds(int day, int month, int year, int hour, int minute)
	{

	       Calendar c = Calendar.getInstance();
	       c.set(year, month, day, hour, minute, 00);
	       System.out.println("Set:"+c.getTimeInMillis());
	       System.out.println("Now:"+System.currentTimeMillis());
	        return c.getTimeInMillis();

	}
    
    
}